//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Platforms/File/FileSystem.h"

#if defined( PLATFORM_SDL )

namespace Engine
{
namespace Platforms
{


	//
	// SDL File System
	//

	class SDLFileSystem : public IFileSystem
	{
	// methods
	public:
		SDLFileSystem (EngineSubSystemsRef ess) : IFileSystem(ess) {}
	};

	

//------------------------ IFileSystem -------------------------//
/*
=================================================
	OpenResource
=================================================
*/
	inline bool IFileSystem::OpenResource (uni_c_string resname, RFilePtr &file) const
	{
		string res = "assets/";	res << resname;
		return OpenForRead( res, file );
	}
	
/*
=================================================
	IsResourceExist
=================================================
*/
	inline bool IFileSystem::IsResourceExist (uni_c_string filename) const
	{
		string res = "assets/";	res << filename;
		return IsFileExist( res );
	}

/*
=================================================
	GetFreeSpace
----
	returns free space on disc (path)
=================================================
*/
	inline uint64 IFileSystem::GetFreeSpace (uni_c_string path) const
	{
		return MaxValue<uint64>();
	}
	
/*
=================================================
	GetTotalSpace
----
	returns total space on disc (path)
=================================================
*/
	inline uint64 IFileSystem::GetTotalSpace (uni_c_string path) const
	{
		return MaxValue<uint64>();
	}



}	// Platforms
}	// Engine

#endif	// PLATFORM_SDL